﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Acoris.Foundation
{
#if WIN2D
    using Microsoft.Graphics.Canvas.Text;
#endif

    class AlignmentHelper
    {
#if WIN2D
        internal static CanvasHorizontalAlignment GetHorizontalAlignment(HorizontalAlignment horizontalAlignment)
        {
            switch (horizontalAlignment)
            {
                case HorizontalAlignment.Auto:
                    return CanvasHorizontalAlignment.Justified;
                case HorizontalAlignment.Center:
                    return CanvasHorizontalAlignment.Center;
                case HorizontalAlignment.Left:
                    return CanvasHorizontalAlignment.Left;
                case HorizontalAlignment.Right:
                    return CanvasHorizontalAlignment.Right;
                default:
                    return CanvasHorizontalAlignment.Left;
            }
        }

        internal static CanvasVerticalAlignment GetVerticalAlignment(VerticalAlignment verticalAlignment)
        {
            switch (verticalAlignment)
            {
                case VerticalAlignment.Center:
                    return CanvasVerticalAlignment.Center;
                case VerticalAlignment.Bottom:
                    return CanvasVerticalAlignment.Bottom;
                case VerticalAlignment.Auto:
                case VerticalAlignment.Top:
                default:
                    return CanvasVerticalAlignment.Top;
                
            }
        }
#endif
    }
}
